home *** CD-ROM | disk | FTP | other *** search
- ANSI VT-100 Escape sequences
- Compiled by Timothy Miller
-
- This is a list of all the ANSI escape sequences that I could find.
- Not all of them are supported by TWS's ANSITERM, but I have marked
- which ones are and which are not.
-
- Spaces are only for clarity. <esc> represents ASCII #27 non-printing
- character.
-
-
- CPR Cursor Position Report
- <esc> [ Row ; Col R
- Terminal responce to DSR.
-
- CUB Cursor Backwards
- <esc> [ n D
- Moves cursor n positions to the left. If n=0, default is 1.
- If attempt is made to move beyond margin, cursor stops ar margin.
-
- CUD Cursor Down
- <esc> [ n B
- Moves cursor n positions down. If n=0, default is 1.
- If attempt is made to move beyond margin, cursor stops ar margin.
-
- CUF Cursor Forward
- <esc> [ n C
- Moves cursor n positions to the right. If n=0, default is 1.
- If attempt is made to move beyond margin, cursor stops ar margin.
-
- CUU Cursor Up
- <esc> [ n A
- Moves cursor n positions up. If n=0, default is 1.
- If attempt is made to move beyond margin, cursor stops ar margin.
-
- CUP Cursor Position
- <esc> [ Row ; Col H
- Moves cursor to position on screen. Columns numbered 1-80, Rows
- 1-24 unless margins set otherwise. If parameter is 0 or missing,
- 1 is default.
-
- DA Device Attributes
- <esc> [ n c
- n should be 0 or missing. Terminal responds:
- <esc> [ ? 1 ; 2 c For ANSI/VT-100 terminal w/o printer
- <esc> [ ? 1 ; 11 c " " " w/ printer
-
- DCH Delete Characters
- <esc> [ n P
- Causes n characters to be removed from the right of the cursor,
- including the cursor. ANSITERM moves the characters to the right of
- the deleted field to be moved left to fill in the empty space.
- Spaces to the right of the moved block are filled with blanks
- with the same character attributes as the last moved character.
-
- DECALN Screen Alignment Display
- <esc> # 8
- Causes the screen to be filled with uppercase E's to assist in
- alligning the screen display. Not supported by ANSITERM.
-
- DECANM ANSI/VT52 Mode
- <esc> [ ? 2 l
- Causes the terminal to switch to VT-52 mode. VT-52 is not
- supported by ANSITERM.
-
- DECARM Auto Repeat Mode
- <esc> [ ? 8 h (on)
- <esc> [ ? 8 l (off)
- Turns key auto-repeat on or off. Not supported by ANSITERM:
- auto-repeat is always on.
-
- DECAWM Autowrap Mode
- <esc> [ ? 7 h (on)
- <esc> [ ? 7 l (off)
- Turns end-of-line wrap on or off. When off, any characters
- displaying at the right margin will replace any character already
- there. When on, these characters appear at the beginning of
- the next line.
-
- DECCKM Cursor Keys Mode
- <esc> [ ? 1 h (application)
- <esc> [ ? 1 l (cursor)
- In application mode, the cursor keys send the following codes:
- left <esc> O D
- down <esc> O B
- right <esc> O C
- up <esc> O A
- In cursor mode (the default), the cursor keys send:
- left <esc> [ D
- down <esc> [ B
- right <esc> [ C
- up <esc> [ A
-
- DECCOLM Column Mode
- <esc> [ ? 3 h (132 columns)
- <esc> [ ? 3 l (80 columns)
- 132 column mode is not supported by ANSITERM.
-
- DECDHL Double Height Line
- Top half: <esc> # 3
- Bottom half: <esc> # 4
- Causes the whole current line to change to double-width,
- double-height top-half or bottom-half. If the line was normal,
- all characters to the right of the center of the screen are lost.
- Cursor remains at the same position unless it would be placed
- beyond the right margin, in which case, it would be placed at
- the right margin.
- Double height is not supported by ANSITERM.
-
- DECDWL Double Width Line
- <esc> # 6
- Causes the current line to become double-width, normal-height.
- If the line was normal, all characters to the right of the center
- of the screen are lost. Cursor remains at the same position
- unless it would be placed beyond the right margin, in which case,
- it would be placed at the right margin.
- Double width is not supported by ANSITERM.
-
- DECEDM Editing Mode
- <esc> [ ? 10 h (edit)
- <esc> [ ? 10 l (interactive)
- In edit mode, characters are only sent when you press return
- (I think). Interactive mode is normal.
- ANSITERM does not support Editing mode.
-
- DECEKEM Edit Key Execution Mode
- <esc> [ ? 16 h (immediate)
- <esc> [ ? 16 l (defer)
- In immediate state, if the user puts the terminal in edit mode,
- the host computer is told. In the defer state, if the user attempts
- to put the terminal in edit mode, the host computer is asked first.
- ANSITERM is not an editing terminal.
-
- DECID Identity Terminal
- <esc> Z
- Same as DA, never use this. ANSITERM doesn't support it either.
-
- DECINLM Interlace Mode
- <esc> [ ? 9 h (on)
- <esc> [ ? 9 l (off)
- ANSITERM ignores this command.
-
- DECKPNM Keypad Numeric Mode
- <esc> >
- Causes the numeric keypad to send the characters which appear
- on the keytops.
-
- DECKPAM Keypad Application Mode
- <esc> =
- Causes the numeric keypad to transmit the following sequences:
- (PF1) (PF2) (PF3) (PF4)
- '(' <esc> O P ')' <esc> O Q '/' <esc> O R '*' <esc> O S
- '7' <esc> O w '8' <esc> O x '9' <esc> O y '-' <esc> O m
- '4' <esc> O t '5' <esc> O u '6' <esc> O v '+' <esc> O 1
- '1' <esc> O q '2' <esc> O r '3' <esc> O s
- '0' <esc> O p '.' <esc> O n ENTER <esc> O M
- On some terminals, there is a TAB key in place of a '+' key, and
- PF1 - PF4 are the top row of keys.
-
- DECLL Load LED's
- <esc> [ n q
- Depending on n, the following action is preformed:
- 0 Clear LED's 1 and 2
- 1 Set LED 1
- 2 Set LED 2
- LED's are not supported by ANSITERM.
-
- DECLTM Line Transmit Mode
- <esc> [ ? 11 h (line)
- <esc> [ ? 11 l (page)
- In edit mode, line, page, or partial page is transmitted by the
- terminal. Edit mode is not supported by ANSITERM.
-
- DECXMIT Transmit
- <esc> 5
- Causes the terminal to transmit the line being edited as if the
- user had pressed return to send it. Edit mode is not supported
- by ANSITERM.
-
- DECOM Origin Mode
- <esc> [ ? 6 h (relative)
- <esc> [ ? 6 l (absolute)
- In relative mode, cursor positions are numbered with respect with
- the current scrolling region. In absolute mode, cursor positions
- are numbered with respect to the whole screen.
-
- DECPRO Protected Field Attributes
- <esc> [ n ; ... ; n }
- According to n, sets the following:
- 0 no fields are protected
- 1 bold implies protection
- 4 underline implies protection
- 5 blinking implies protection
- 7 reverse video implies protection
- 254 all attributes off (normal) implies protection
- Since ANSITERM is not an editing terminal, it does not support
- field protection.
-
- DECSC Save Cursor
- <esc> 7 (standard)
- <esc> [ s (this must be VT-102 only)
- Saves current cursor position and printing attributes. ANSITERM
- only saves position.
-
- DECRC Restore Cursor
- <esc> 8 (standard)
- <esc> [ u (this must be VT-102 only)
- Restores cursor to a previously stored position.
-
- DECREQTPARM Request Terminal Parameters
- <esc> [ n x
- n will be 0 or 1. Terminal responds with DECREPTPARM.
-
- DECREPTPARM Report Terminal Parameters
- <esc> [ sol ; par ; nbits ; xspeed ; rspeed ; clkmul ; flags x
- Terminal's responce to DECREQTPARM. Parameters are:
- sol : is DECREQTPARM's n is 0, sol = 2. If n is 1, sol = 3
- par : parity:
- 1 none
- 2 space
- 3 mark
- 4 odd
- 5 even
- ANSITERM sends 1
- nbits: 1 for 8 bits, 2 for 7 bits per char (default 1)
- xspeed, rspeed:
- code baud
- 0 50
- 8 75
- 16 110
- 24 134.5
- 32 150
- 40 200
- 48 300
- 56 600
- 64 1200
- 72 1800
- 80 2000
- 88 2400
- 96 3600
- 104 4800
- 112 9600
- 120 19200
- clkmul: 1 (bit rate multiplier is 16)
- flag: 0-15 (ignored)
-
- DECSCFDM Space Compression/Field Delimiting Mode
- <esc> [ ? 13 h (on)
- <esc> [ ? 13 l (off)
- Sets mode for sending data in edit mode. ANSITERM does not support
- edit mode.
-
- DECSCLM Scrolling Mode
- <esc> [ ? 4 h (smooth)
- <esc> [ ? 4 l (jump)
- ANSITERM does not support smooth scrolling.
-
- DECSCNM Screen Mode
- <esc> [ ? 5 h (normal)
- <esc> [ ? 5 l (reverse)
- In normal mode, the screen text is light on dark. In reverse mode,
- the screen text is dark on light. ANSITERM is always in normal
- mode.
-
- DECSTBM Set Top and Bottom Margins
- <esc> [ top ; bottom r
- Sets top and bottom margins of scrolling region.
-
- DECSWL Single-Width Line
- ESC # 5
- Sets current line to normal width and heigth.
- Not supported by ANSITERM
-
- DECTEM Transmit Execution Mode
- <esc> [ ? 14 h (immediate)
- <esc> [ ? 14 l (defer)
- In edit mode, immediate sends line or field being edited when
- user presses return. Defer mode asks the host first by sending
- an <esc> S sequence. The terminal will only then send the line
- if the host sends a DECXMIT command. ANSITERM does not support
- edit mode.
-
- DECTST Invoke Confidence Test
- <esc> [ 2 ; n y
- Performs tests on the terminal. n indicates the text to be done
- and is calculated by adding together one or more of the following
- values:
- Power up self-test
- (EPROM and EAROM cksums, RAM test, keyboard test) 1
- Data loopback test
- (loopback connector required) 2
- EIA modem loopback test
- (loopback connector requited) 4
- Repeat selected test(s) indefinitely
- (until failure or power off) 8
- ANSITERM supports none of these tests.
-
- DECTTC Transmit Termination Character
- <esc> [ n |
- Where n is one of the following:
- 0 none (function disabled)
- 1 FF (form feed)
- ANSITERM ignores this.
-
- DL Delete Line
- <esc> [ n M
- n lines are deleted, including the line which the cursor is on.
- Lines below are moved up, and new blank lines appear at the bottom.
-
- DSR Device Status Report
- <esc> [ x n
- Where n is actually a literal n, and x is one of the following:
- 0 terminal responce - no malfunction
- 3 terminal responce - malfunction - retry
- 5 command from host - report status using DSR
- 6 command from host - report cursor position with CPR
- The host sends a request using options 5 or 6, and the terminal
- responds with "<esc> [ 0 n" or a CPR sequence, respectively.
-
- ED Erase in Display
- <esc> [ n J
- Erases characters in the display, with n specifying one of the
- following:
- 0 Erase from the cursor position to the end of the display,
- inclusive.
- 1 Erase from the start of the display to the cursor position,
- inclusive.
- 2 Erase the entire display. ANSITERM resets screen
- attributes to normal, but leaves the drawing attributes
- for new characters set as before.
-
- EL Erase Line
- <esc> [ n K
- Erases characters in the line according to n:
- 0 Erase from the cursor position to the end of the line,
- inclusive.
- 1 Erase from the start of the line to the cursor position,
- inclusive.
- 2 Erase entire line.
-
- ERM Erasure mode
- <esc> [ 6 h (erase all)
- <esc> [ 6 l (erase unprotected)
- In the reset state (erase unprotected), only unprotected characters
- on the screen can be cleared with ED or EL. In the set state
- (erase all), any characters on the screen can be cleared with ED
- or EL. ANSITERM is not an editing terminal and does not support
- this.
-
- GATM Guarded Area Transmit
- <esc> [ 1 h (send all)
- <esc> [ 1 l (send unprotected)
- In the reset state, only unprotected fields are transmitted to the
- host when requested (seperated by record separator when a protected
- field is encountered. In the set state, all is transmitted.
- ANSITERM is not an editing terminal and does support this.
-
- HTS Horizontal Tabulation Set
- <esc> H
- Sets a horizontal tab stop at the current cursor column.
-
- HVP Horizontal and Vertical Position
- <esc> [ row ; col f
- Moves the cursor to a specified position on the screen.
-
- IL Insert Line
- <esc> [ n L
- Moves all lines below and including the one the cursor is on down
- n lines, discards all lines that scroll off the bottom of the
- display, and inserts blank lines into the empty space.
-
- IND Index
- <esc> D
- Acts same as a linefeed. Moves cursor down, maintaining the same
- column, and if the cursor is at the bottom of the scrolling region,
- a scroll up is preformed.
-
- IRM Insert/Replacement Mode
- <esc> [ 4 h (insert)
- <esc> [ 4 l (replace)
- In insert mode, when a character is displayed all characters on the
- line to the right of the cursor are moved right before the character
- is displayed. Any character at the right most column is discarded.
- In the replace mode (normal), any character at the cursor position
- is overwritten by any new received character.
-
- KAM Keyboard Action Mode
- <esc> [ 2 h (disabled)
- <esc> [ 2 l (enabled)
- Enables or disables the keyboard. ANSITERM does not support this.
-
- LNM Line Feed/New Line Mode
- <esc> [ 20 h (new line)(on)
- <esc> [ 20 l (line feed)(off)
- In line feed mode, line feed only implies vertical movement and
- a carriage return is required to return to the left most column.
- The return key sends only a carriage return in this mode.
- In the new line mode, line feed implies both vertical movement and
- return to the left most column. In this mode, the return key
- sends both carriage return and line feed. New line mode does not
- affect IND or NEL.
-
- NEL Next Line
- <esc> E
- This causes the cursor to move to the left most column of the next
- line. Same as carriage return followed by line feed.
-
- NP Next Page
- <esc> [ n U
- Causes the nth page down to be displayed. ANSITERM does not support
- more than one display page.
-
- RI Reverse Index
- <esc> M
- Causes the cursor to move to the same column of the preceding line.
- If the cursor is at the top of the scrolling region, a scroll down
- if preformed.
-
- RIS To Initial State
- <esc> c
- Resets the terminal to its power up state.
-
- RM Reset Mode
- <esc> [ n; n; n; ... n l
- Resets one or more modes specified by each individual n. See
- above sequences for examples of RM sequences.
-
- SCS Select Character Set
- Selects a character set. One of two sets may be selected quickly
- after being set with the following sequences:
- Shift In (Ctrl-N) Shift Out (Ctrl-O)
- <esc>(A <esc>)A United Kingdom
- <esc>(B <esc>)B Ascii
- <esc>(0 <esc>)0 Business Graphics
- Any selection other than A, B, or 0 will default to Ascii.
- ANSITERM supports only Ascii and IBMECGS character sets.
-
- SGR Select Graphics Rendition
- <esc> [ n; ... n m
- This sequence sets one or more character drawing attribute according
- to the following table:
- VT-100 Commands
- n Meaning
- 0 all attributes off
- 1 bold
- 4 underline (NOW supported by ANSITERM)
- 5 blink (IS supported by ANSITERM)
- 7 reverse video
- VT-102 Commands
- 30+c foreground color
- 40+c background color
- where c is one of the following:
- 0 black
- 1 red
- 2 green
- 3 brown/yellow
- 4 blue
- 5 magenta
- 6 cyan
- 7 grey/white
-
- SM Set Mode
- <esc> [ n; ... ; n h
- Sets one or more modes specified by each individual n. See
- above sequences for examples of SM sequences.
-
- TBC Tabulation Clear
- <esc> [ n g
- Clears horizontal tab stops according to n:
- 0 clear tab at cursor position
- 3 clear all tabs
-
- TTM Transfer Termination Mode
- <esc> [ 16 h (page)
- <esc> [ 16 l (partial page)
- This is an edit mode command. In the set state, the entire scrolling
- region is transmitted. In the reset state, all characters from the
- beginning of the scrolling region or the last partial page, to (but
- not including) the cursor position are transmitted.
- ANSITERM is not an editing terminal.
-
- Here's one I didn't find until I picked it out of my capture buffer:
- ??? Insert Char
- <esc> [ n @
- This is what one version of SearchLight BBS sends when it's trying
- to insert a character. I'm just assuming that you can add that
- optional n parameter to specify how many characters to insert.
- What I actually found was just an <esc>[@ where it unsuccessfully
- tried to insert.
-